package com.cpp.common.enums;

import lombok.Getter;

@Getter
public enum QuestionDifficultyType {
    EASY(1, "简单"),
    MEDIUM(2, "中等"),
    HARD(3, "困难");
        private Integer code;
        private String message;
    QuestionDifficultyType(Integer code, String message) {
            this.code = code;
            this.message = message;
        }
        public static String getMessageByCode(Integer code){
            for (QuestionDifficultyType value : QuestionDifficultyType.values()) {
                if (value.getCode().equals(code)) {
                    return value.getMessage();
                }
            }
            return null;
        }

}
